package com.treasure.mall.zbq.common.ienum.auction;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.treasure.mall.zbq.common.constant.Constant;
import com.treasure.mall.zbq.common.ienum.base.CodeDescCommonEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/7/16
 */
public interface AuctionEnums {
    @AllArgsConstructor
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    @Getter
    enum AuctionStatus implements CodeDescCommonEnum {
        TO_START(0, "未开始"),
        IN_AUCTION(1, "拍卖中"),
        END(2, "拍卖结束");

        private Integer code;
        private String desc;

        public String statusClass() {
            switch (this) {
                case TO_START:
                    return Constant.COLOR_WARNING;
                case IN_AUCTION:
                    return Constant.COLOR_DANGER;
                default:
                    return Constant.COLOR_PRIMARY;
            }
        }
    }
}
